#set( $symbol_pound = '#' )
#set( $symbol_dollar = '$' )
#set( $symbol_escape = '\' )
package ${package}.oauth.facade.impl;

import ${package}.oauth.facade.AuthorizeConfigManager;
import ${package}.oauth.facade.AuthorizeConfigProvider;
import lombok.AllArgsConstructor;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configurers.ExpressionUrlAuthorizationConfigurer;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * Description:
 *  实现权限句柄管理器
 *
 * @author wupanhua
 * @date 2019-09-01 17:31
 *
 * <pre>
 *              ${copyright}
 *      Copyright (c) 2019. All Rights Reserved.
 * </pre>
 */
@Component
@AllArgsConstructor
public class AuthorizeConfigManagerImpl implements AuthorizeConfigManager {

    /**
     * 权限配置合集
     */
    private final List<AuthorizeConfigProvider> authConfigProviders;

    @Override
    public void config(ExpressionUrlAuthorizationConfigurer<HttpSecurity>.ExpressionInterceptUrlRegistry config) {
        for (AuthorizeConfigProvider authConfigProvider : authConfigProviders) {
            authConfigProvider.config(config);
        }
    }
}
